package com.bjwl.web.contrlller.admin;

import com.bjwl.pojo.dto.PrintingDto;
import com.bjwl.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: dzx
 * @Date:Create：in 2020/5/14 8:39
 * @Description:
 * @Modified By：
 * @Version: 1.0
 */
@Controller
@RequestMapping("/admin")
public class PrintingController {

    @Autowired
    private OrdersService ordersService;

    @RequestMapping("/printingOrder")
    public String printingOrder(Integer id, Model model) {
        if (ordersService.findOrderCardIdById(id)) {
            PrintingDto printingDto = ordersService.findPrintingById(id);
            model.addAttribute("printingDto", printingDto);
        }else {
            PrintingDto printingDto = ordersService.findPrintingByIdtwo(id);
            model.addAttribute("printingDto", printingDto);
        }
        return "main_oa/printing";
    }

}
